home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 3667 < prev    next >
Encoding:
Text File  |  1996-08-06  |  933 b   |  34 lines

  1. Newsgroups: comp.lang.c++
  2. Path: peer-news.britain.eu.net!uknet!owl-uk!news
  3. From: Kenn@owl-uk.co.uk (Ken Nicolson)
  4. Subject: Re: [] overloding vc4.0
  5. Message-ID: <31076a6e.3951286@hector>
  6. Sender: news@owl-uk.co.uk (News system)
  7. Organization: Office Workstations Limited
  8. X-Newsreader: Forte Agent .99c/16.141
  9. References: <NEWTNews.822530713.12255.moti@motisaad.netmanage.co.il>
  10. Date: Thu, 25 Jan 1996 11:36:41 GMT
  11.  
  12. Moti Saadon <moti@netmanage.co.il> wrote:
  13.  
  14. >
  15. >Why can't I compile this code at vc++4.0?
  16. >Thanks.
  17. >
  18. >//----------------------------begin code-----------------
  19. >
  20. [snip!]
  21. >
  22. >//now comes the definition of the subscript operator
  23. >template <class Type>
  24. >Type &Array::operator[] (int i)
  25.  
  26. Type &Array<Type>::operator[] (int i)
  27.            ^^^^^^
  28.  
  29. I found the answer in vc++4.0 by hitting the F1 key on the highlighted
  30. "template" keyword, and the correct syntax for declaring a member
  31. function is right there on the help page.
  32.  
  33. Ken
  34.